import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import qiankun from 'vite-plugin-qiankun'
import path from "path"

// https://vitejs.dev/config/
export default defineConfig({
  base: process.env.NODE_ENV === 'production' ? 'http://localhost:1002/' : '/', // qiankun环境下，因为vite不支持运行时publicPath，只能在打包时写死Base配置
  plugins: [
    vue(),
    qiankun('vue3', {
      useDevMode: true
    })
  ],
  server: {
    origin: 'http://localhost:8083/',
    port: 8083,
    headers: {
      'Access-Control-Allow-Origin': '*'
    }
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src")
    }
  }
})
